/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.era7bioinformatics.aws.s3.components.generic.data.awsMetadata

import com.era7bioinformatics.aws.s3.components.generic.data.MetadataKey



object AwsMetadata extends MetadataKey {

  //override val name:String = AwsMetadata.name

  override val name:String = ""


  def apply(aName: String): Option

  def unapply(aName: String): Option[String] =

    aName match {

      case ETAG() => Some(ETAG.name)
      case DATE() => Some(DATE.name)
      case LAST_MODIFIED() => Some(LAST_MODIFIED.name)
      case CONTENT_TYPE() => Some(CONTENT_TYPE.name)
      case CONTENT_LENGTH() => Some(CONTENT_LENGTH.name)
      case _ => None
  }


}


sealed trait AwsMetadata extends MetadataKey {

  //def is(aName: String): Boolean = aName.equals(name)

  
}




object ETAG extends AwsMetadata {

    override val name = "ETag"

    def unapply(aName:String): Boolean = aName.equals(name)
  }

  object LAST_MODIFIED extends AwsMetadata {

    override val name = "Last-Modified"
    def unapply(aName: String): Boolean = aName.equals(name)
  }

  object DATE extends AwsMetadata {

    override val name = "Date"
    def unapply(aName: String): Boolean = aName.equals(name)
  }

  object CONTENT_TYPE extends AwsMetadata {

    override val name = "Content-Type"
    def unapply(aName: String): Boolean = aName.equals(name)
  }

  object CONTENT_LENGTH extends AwsMetadata {

    override val name = "Content-Length"
    def unapply(aName: String): Boolean = aName.equals(name)
  }

